From: Ewan Mellor Date: Tue, 20 Mar 2007 17:33:35 +0000 (+0000) Subject: Fix xm block-list through the Xen-API for managed domains. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15282^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f7bff36895f3c96edb433221a40ee53b261a0068;p=xen.git Fix xm block-list through the Xen-API for managed domains. Signed-off-by: Tom Wilkie --- diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index 5f8449d376..c5b640ccec 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -37,6 +37,7 @@ import time import datetime from select import select import xml.dom.minidom +from xen.util.blkif import blkdev_name_to_number import warnings warnings.filterwarnings('ignore', category=FutureWarning) @@ -1724,7 +1725,12 @@ def xm_block_list(args): vbd_refs = server.xenapi.VM.get_VBDs(get_single_vm(dom)) vbd_properties = \ map(server.xenapi.VBD.get_runtime_properties, vbd_refs) - devs = map(lambda x: [x.get('virtual-device'), map2sxp(x)], vbd_properties) + vbd_devs = \ + map(server.xenapi.VBD.get_device, vbd_refs) + vbd_devids = \ + map(blkdev_name_to_number, vbd_devs) + devs = map(lambda (devid, prop): [devid, map2sxp(prop)], + zip(vbd_devids, vbd_properties)) else: devs = server.xend.domain.getDeviceSxprs(dom, 'vbd')